

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Create Resource</title>         
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${resource(dir:'')}">Home</a></span>
            <span class="menuButton"><g:link class="list" action="list">Resource List</g:link></span>
        </div>
        <div class="body">
            <h1>Create Resource</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${resourceInstance}">
            <div class="errors">
                <g:renderErrors bean="${resourceInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" method="post" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="controllerName">Controller Name:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:resourceInstance,field:'controllerName','errors')}">
                                    <input type="text" id="controllerName" name="controllerName" value="${fieldValue(bean:resourceInstance,field:'controllerName')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="actionName">Action Name:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:resourceInstance,field:'actionName','errors')}">
                                    <input type="text" id="actionName" name="actionName" value="${fieldValue(bean:resourceInstance,field:'actionName')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="resourceType">Resource Type:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:resourceInstance,field:'resourceType','errors')}">
                                    <g:select id="resourceType" name="resourceType" from="${resourceInstance.constraints.resourceType.inList}" value="${resourceInstance.resourceType}" ></g:select>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="name">Name:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:resourceInstance,field:'name','errors')}">
                                    <input type="text" id="name" name="name" value="${fieldValue(bean:resourceInstance,field:'name')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="orderNum">Order Num:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:resourceInstance,field:'orderNum','errors')}">
                                    <input type="text" id="orderNum" name="orderNum" value="${fieldValue(bean:resourceInstance,field:'orderNum')}" />
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="parent">Parent:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:resourceInstance,field:'parent','errors')}">
                                    <g:select optionKey="id" from="${Resource.list()}" name="parent.id" value="${resourceInstance?.parent?.id}" noSelection="['null':'']"></g:select>
                                </td>
                            </tr> 
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><input class="save" type="submit" value="Create" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
